﻿using System;
using System.IO;
using System.Threading.Tasks;

namespace _062.没有async的异步方法
{
	internal class Program
	{
		static void Main(string[] args)
		{
			
		}

		static async Task<string> ReadFileAsync(int num)
		{
			switch (num)
			{
				case 1:
					return await File.ReadAllTextAsync("d:/1.txt");
				case 2:
					return await File.ReadAllTextAsync("d:/2.txt");
				default:
					throw new ArgumentException("num invalid");
			}
		}

		static Task<string> ReadFileAsync2(int num)
		{
			switch (num)
			{
				case 1:
					return File.ReadAllTextAsync("d:/1.txt");
				case 2:
					return File.ReadAllTextAsync("d:/2.txt");
				default:
					throw new ArgumentException("num invalid");
			}
		}

	}
}
